package geometry;

/**
 *
 * @author różański
 */
public class Vertex {

    private double x, y;

    public Vertex(double x, double y) {
        this.x = x;
        this.y = y;
    }

    public double getX() {
        return x;
    }

    public double getY() {
        return y;
    }

    public Vertex traverse(double angle, double length) {
        return new Vertex(x + Math.cos(angle) * length, y + Math.sin(angle) * length);
    }

    @Override
    public String toString() {
        return "(" + x + "," + y + ")";
    }
}
